package com.db.organization;

import java.util.*;
import org.springframework.orm.ibatis.SqlMapClientTemplate;

public class DeptJobDAO {
	private SqlMapClientTemplate template;
	
	public void setTemplate(SqlMapClientTemplate template) {
		this.template = template;
	}

	@SuppressWarnings("unchecked")
	public List<DeptVO> getDeptList(){
		List<DeptVO> list = new ArrayList<DeptVO>();
		try {
			list = template.queryForList("deptListAll");
		} catch (Exception e) {
			System.out.println("DeptJobDAO.getDeptList():"+e.toString());
		}
		return list; 
	}	
	
	@SuppressWarnings("unchecked")
	public List<JobVO> getJobList(){
		List<JobVO> list = new ArrayList<JobVO>();
		try {
			list = template.queryForList("jobListAll");
		} catch (Exception e) {
			System.out.println("DeptJobDAO.getJobList():"+e.toString());
		}
		return list;
	}
	
	public int getSlevel(int jobno){
		Integer it = new Integer(0);
		try {
			it = (Integer)template.queryForObject("jobGetSlevel", jobno);
		} catch (Exception e) {
			System.out.println("DeptJobDAO.getSlevel():"+e.toString());
		}				
		return it.intValue();
	}
}
